package ua.maxicash.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ua.maxicash.dao.WorkerDao;
import ua.maxicash.vo.Worker;

@Service("workerService")
public class WorkerServiceImpl implements WorkerService{

	@Autowired
	WorkerDao workerDao;
	
	@Override
	public boolean emailIsFree(String email) {
		
		return workerDao.emailIsFree(email);
		
	}

	@Override
	public void addWorker(Worker worker) {
		workerDao.addWorker(worker);
		
	}
	
	@Override
	public void updateWorker(Worker worker) {
        workerDao.updateWorker(worker);
		
	}

	@Override
	public List listWorker() {
		return workerDao.listWorker();
	}

	@Override
	public Worker getWorkerByEmail(String email) {
	
		return workerDao.getWorkerByEmail(email);
	}

    @Override
    public Worker getWorkerById(Long idWorker) {
        return workerDao.getWorkerById(idWorker);
    }
}
